﻿using System;
using System.Collections.Generic;
using System.Data.Linq;
using System.Linq;
using System.Text;
using ORM_Benchmark.Runner.Interface;

namespace ORM_Benchmark.Runner.Linq2Sql
{
    public class Linq2SqlProductContext : DataContext
    {
        public Linq2SqlProductContext(IConnect connect) : base(connect.ConnectionString) { }

        public IQueryable<LinqProduct> Products { get { return GetTable<LinqProduct>(); } }

        public void Insert(IEnumerable<LinqProduct> linqProducts)
        {
            GetTable<LinqProduct>().InsertAllOnSubmit(linqProducts);
            SubmitChanges();
        }

        public void Update(IEnumerable<LinqProduct> linqProducts)
        {
            SubmitChanges();
        }
    }
}
